package com.core.gwt.ui.client;

import com.google.gwt.user.client.Command;

/**
 * An object that represents a string associated with a target history token or
 * a {@link Command}.
 * 

 */
public class HyperString {
	private String text;
	private String targetHistoryToken;
	private Command command;

	/**
	 * Initializes an empty hyper-string.
	 */
	public HyperString() {

	}

	/**
	 * Initializes a hyper-string with the specified text.
	 */
	public HyperString(final String text) {
		super();
		this.text = text;
	}

	/**
	 * Initializes a hyper-string with the specified text and {@link Command}.
	 */
	public HyperString(final String text, final Command command) {
		super();
		this.text = text;
		this.command = command;
	}

	/**
	 * Initializes a hyper-string with the specified text and target history
	 * token.
	 */
	public HyperString(final String text, final String targetHistoryToken) {
		this.text = text;
		this.targetHistoryToken = targetHistoryToken;
	}

	/**
	 * Returns the {@link Command}.
	 */
	public Command getCommand() {
		return command;
	}

	/**
	 * Returns the target history token.
	 */
	public String getTargetHistoryToken() {
		return targetHistoryToken;
	}

	/**
	 * Returns the text.
	 */
	public String getText() {
		return text;
	}

	/**
	 * Sets the {@link Command}.
	 */
	public void setCommand(final Command command) {
		this.command = command;
	}

	/**
	 * Sets the target history token.
	 */
	public void setTargetHistoryToken(final String targetHistoryToken) {
		this.targetHistoryToken = targetHistoryToken;
	}

	/**
	 * Sets the text.
	 */
	public void setText(final String text) {
		this.text = text;
	}
}
